var api = require('../../utils/api.js')
var app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        id:'',
        key:''
    },
    getkeys(ret){
        this.setData({
            key:ret.detail.value
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        var id=options.id;

        this.setData({
            id:id
        })
        this.getlistbydcateid();
    },

    getvideobykye(){
        this.setData({
            list:[]
        })
        this.getlistbydcateid();
    },
    getlistbydcateid(){

        var id=this.data.id;
        var key=this.data.key;
        var that=this;
        api.post({
            url: 'ziliao/getlistbydcateid',
            data: {id:id,key:key},
            success: data => {
                console.log(data);
                that.setData({
                    list:data.data
                })
            }
        });
    },
    getziliaobyid(ret){
        console.log(ret);
        var id=ret.currentTarget.dataset.id;
        wx.navigateTo({
          url: '/pages/ziliao/info?id='+id
        })
    }

})